﻿<%@ Page Language="C#" MasterPageFile="~/MuseumOwner.master" AutoEventWireup="true"
    CodeFile="ManageMuseum.aspx.cs" Inherits="ManageMuseum" Title="Manage Museums" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%" cellspacing="0" cellpadding="0" border="0">
        <tr>
            <td colspan="3" align="center">
                <b style="font-size: x-large;">MUSEUM LISTING</b>
            </td>
        </tr>
        <tr>
            <td>
                <div id="divGridView">
                    <asp:GridView ID="GridViewMuseums" runat="server" EnableViewState="False" Width="100%"
                        BorderWidth="1" CellPadding="4" ForeColor="#333333" GridLines="Both" AutoGenerateColumns="false"
                        DataKeyNames="MuseumID" AutoGenerateDeleteButton="false" EmptyDataText="No records found"
                        AllowPaging="true" AllowSorting="true" PageSize="10" AlternatingRowStyle-BackColor="White"
                        OnPageIndexChanging="gridView_PageIndexChanging" OnSorting="gridView_Sorting"
                        RowStyle-CssClass="record" OnRowDeleting="DeleteRecord">
                        <RowStyle CssClass="record"></RowStyle>
                        <HeaderStyle BackColor="#A59072" HorizontalAlign="Left" Font-Bold="True" ForeColor="White" />
                        <Columns>
                            <asp:BoundField DataField="MuseumID" HeaderText="ID" />
                            <asp:TemplateField HeaderText="NAME">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkbtnMuseumName" Text='<%# Eval("MuseumName")%>' CommandArgument='<%# Eval("MuseumID") %>' runat="server" 
                                    OnClick="LinkButton1_Click"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="ADDRESS" DataField="MuseumAddress" />
                            <asp:BoundField HeaderText="CITY" DataField="CityName" />
                            <asp:BoundField HeaderText="DETAILS" DataField="MuseumInfo" />
                            <asp:BoundField HeaderText="PARTNER" DataField="IsPartner" />
                            <asp:BoundField HeaderText="RATING" DataField="MuseumRating" />
                            <%--<asp:TemplateField HeaderText="Rating">
                                <ItemTemplate>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <cc1:Rating ID="Rating1" runat="server" CurrentRating='<%# String.IsNullOrEmpty(Eval("MuseumRating").ToString())?0:Eval("MuseumRating") %>'  
                                            StarCssClass="avgratingStar"
                                            WaitingStarCssClass="avgsavedRatingStar"
                                            FilledStarCssClass="avgfilledRatingStar"
                                            EmptyStarCssClass="avgemptyRatingStar" 
                                            MaxRating="10">
                                            </cc1:Rating>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:TemplateField HeaderText="EDIT">
                                <ItemTemplate>
                                    <a href="MuseumDetails.aspx?PageMode=Edit&MuseumID=<%# Eval("MuseumID") %>" title="Edit">
                                        Edit</a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="DELETE">
                                <ItemTemplate>
                                    <span onclick="return confirm('Are you sure to Delete the record?')">
                                        <asp:LinkButton ID="lnkB" runat="Server" Text="Delete" CommandName="Delete"></asp:LinkButton>
                                    </span>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <p>
                        <asp:Label ID="lblMessage" runat="server" EnableViewState="false" ForeColor="Red" />
                    </p>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
